using System.Collections.Generic;

public class Table_SoundTempItem
{
    /// <summary>
    /// 唯一ID
    /// <summary>
    public int Id { get; private set; }
    /// <summary>
    /// 文件名称
    /// <summary>
    public string ResName { get; private set; }
    /// <summary>
    /// 音量
    /// <summary>
    public float Volume { get; private set; }
    /// <summary>
    /// 是否循环
    /// <summary>
    public bool IsLoop { get; private set; }
    /// <summary>
    /// 音效类型
    /// <summary>
    public int SoundType { get; private set; }
    /// <summary>
    /// 播放类型
    /// <summary>
    public int PlayType { get; private set; }
    /// <summary>
    /// 最大音量
    /// <summary>
    public float MinDis { get; private set; }
    /// <summary>
    /// 最小音量
    /// <summary>
    public float MaxDis { get; private set; }
    /// <summary>
    /// 音效点坐标
    /// <summary>
    public float PosX { get; private set; }
    /// <summary>
    /// 音效点坐标
    /// <summary>
    public float PosY { get; private set; }
    /// <summary>
    /// 音效点坐标
    /// <summary>
    public float PosZ { get; private set; }

    public Table_SoundTempItem(ExcelLineReader reader)
    {
        Id = reader.ReadInt();
        ResName = reader.ReadString();
        Volume = reader.ReadFloat();
        IsLoop = reader.ReadBool();
        SoundType = reader.ReadInt();
        PlayType = reader.ReadInt();
        MinDis = reader.ReadFloat();
        MaxDis = reader.ReadFloat();
        PosX = reader.ReadFloat();
        PosY = reader.ReadFloat();
        PosZ = reader.ReadFloat();
    }
}

public class Table_SoundTempMgr : IDataMgr
{
    protected override string FileName { get { return "Txt/SoundTemp.txt"; } }

    protected List<Table_SoundTempItem> mItemList = new List<Table_SoundTempItem>();
    public Table_SoundTempItem GetItemByIdx(int idx)
    {
        return mItemList[idx];
    }
    public Table_SoundTempItem GetItemById(int id)
    {
        int idx = GetIdxById(id);
        return GetItemByIdx(idx);
    }

    public override void Load(ExcelLineReader reader)
    {
        var item = new Table_SoundTempItem(reader);
        mItemDic.Add(item.Id, mDataCount);
        mItemList.Add(item);
    }
}